


//
//  WebViewController.m
//  广告页
//
//  Created by YYY on 2017/2/17.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()

@end

@implementation WebViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //创建webview
    [self createWebView];
    // Do any additional setup after loading the view.
}

//创建webview
-(void)createWebView
{
    self.myWebView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
    [self.view addSubview:self.myWebView];
    NSURL *url = [NSURL URLWithString:_webUrlStr];
    [self webViewLoadRequest:url];
}

//开始加载网页
-(void)webViewLoadRequest:(NSURL *)url
{
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0f];
    [self.myWebView loadRequest:request];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
